package com.shujia.day03;

public class Code13Functions {
    public static void main(String[] args) {

        // 阶乘 4！ = 1 * 2 * 3 * 4

        int num = 4;
        System.out.println(interFunction(num)); //初始化条件
    }

    public static int interFunction(int num){

        // 如果num是> 1 那么是需要调用自身
        if(num > 1){
            int nextNum = interFunction(num - 1);
            System.out.println(num+"*"+nextNum);
            return num * nextNum;
        }else {
            return 1;
        }
    }
}
